package com.huanwei.me_question.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.huanwei.cc.R;
import com.huanwei.cc.base.Base_Z_Adapter;
import com.huanwei.cc.base.MyApplication;
import com.huanwei.cc.bean.KeBiao;
import com.huanwei.cc.newbean.KeCheng;


/**
 * Created by 他的猫 on 2016/12/3.
 * 我的went适配器
 */

public class KB_Adapter extends Base_Z_Adapter {
    KB_Adapter.Holder holder;


    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        // 查找控件
        if (null == convertView) {
            convertView = LayoutInflater.from(MyApplication.getInstance())
                    .inflate(R.layout.item_wdkb, null);
            holder = new KB_Adapter.Holder();
            holder.kemu = (TextView) convertView
                    .findViewById(R.id.kemu);
            holder.name = (TextView) convertView
                    .findViewById(R.id.name);

            holder.xuehao = (TextView) convertView
                    .findViewById(R.id.xuehao);
            holder.laoshiname = (TextView) convertView
                    .findViewById(R.id.laoshiname);


            holder.time = (TextView) convertView
                    .findViewById(R.id.time);
            holder.shijianduan = (TextView) convertView
                    .findViewById(R.id.shijianduan);
            holder.dizhi = (TextView) convertView
                    .findViewById(R.id.dizhi);

            // 缓存Holder
            convertView.setTag(holder);
        } else {
            holder = (KB_Adapter.Holder) convertView.getTag();
        }
        KeBiao.DataBean teacher = (KeBiao.DataBean) mDataList.get(position);
//        holder.kemu.setText("学号:" + teacher.getStudent_number());
        holder.laoshiname.setText("名字:" + teacher.getUser_name());
        holder.time.setText("警号：" + teacher.getNumber());
        holder.shijianduan.setText("地址：" + teacher.getDiqu());
        holder.dizhi.setText("坐标：" + teacher.getAddress());
        holder.kemu.setText("电话：" + teacher.getBanji());
        return convertView;
    }

    public class Holder {
        TextView name, kemu, xuehao, laoshiname, time, shijianduan, dizhi;
    }


}
